package com.foreknow.demo3;

public class SalariedEmployee extends Employee {

    private double monthlySalary;

    public SalariedEmployee(String name, int number, MyDate birthday) {
        super(name, number, birthday); //super.属性  super.方法名（）  super() 调用父类中的构造器
    }

    public SalariedEmployee(String name, int number, MyDate birthday,double monthlySalary) {
        super(name, number, birthday); //super.属性  super.方法名（）  super() 调用父类中的构造器
        this.monthlySalary = monthlySalary;
    }

    public double getMonthlySalary() {
        return monthlySalary;
    }

    public void setMonthlySalary(double monthlySalary) {
        this.monthlySalary = monthlySalary;
    }

    @Override
    public double earnings() {
        return monthlySalary;
    }

    public String toString() {
        return "salariedEmployee" + super.toString();
    }
}
